# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=pyaxmlparser
pkgver=v0.3.31.r13.g446bf7c
pkgrel=1
pkgdesc='A simple parser to parse Android XML file.'
arch=('any')
groups=('blackarch' 'blackarch-mobile' 'blackarch-misc')
url='https://github.com/appknox/pyaxmlparser'
license=('Apache')
depends=('python' 'python-lxml' 'python-click' 'python-asn1crypto'
         'python-pytest' 'flake8' 'python-coverage')
makedepends=('git' 'python-setuptools')
source=("git+https://github.com/appknox/$pkgname.git")
sha512sums=('SKIP')

pkgver() {
  cd $pkgname

  git describe --long --tags | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
}

build() {
  cd $pkgname

  python setup.py build
}

package() {
  cd $pkgname

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  install -Dm 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
  install -Dm 644 -t "$pkgdir/usr/share/doc/$pkgname/" *.rst *.in
}

